//app.js
var util = require('/database/data.js');
App({
  globalData: {
    smsbaoApi: "https://www.smsbao.com",
    mapApi:"https://api.map.baidu.com",
  },
  onLaunch: function(e) {
    var order = wx.getStorageSync('order');
     this.clearStorage('order',order)
     var more = wx.getStorageSync('more');
     this.clearStorage('more', more)
    
  },
  clearStorage : function (key,data){
    var data_len = data.length;
    if(data_len > 100){
      data.shift();
    }
    wx.setStorageSync(key, data);
  },
  onPageScroll: function (e) {
    //动态计算出分类区的高度
    let that = this;
    var query = wx.createSelectorQuery();
    query.select('#index_navs').boundingClientRect();
    query.exec(function (res) {
      var resHeight = res[0].height - 40;
      if (resHeight < e.scrollTop) {
        that.setData({
          screen_fload_show: true,
        })
      } else {
        that.setData({
          screen_fload_show: false,
        })
      }
    })

  },
})